<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jquery-jsonp</title>
    <!-- www.bootcdn.cn -->
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>

<body>
    <button>点击使用jquery发送jsonp请求</button>
    <div></div>
</body>
<script>
    $('button').click(function() {
        $.getJSON('http://127.0.0.1:8000/jquery-jsonp?callback=?', function(data) {
            $('div').html(`
            名称：${data.name}<br>
            城市：${data.city}
            `)
        })
    })
</script>

</html>